<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">

<h:head></h:head>
<body>
				<p:panelGrid>

					<f:facet name="header">
						<h:outputText value="Your personal data" style="font-weight:bold"/>
					</f:facet>
					<p:row><br/></p:row>
					<p:row>
						<p:column>
							<p:outputLabel for="surname" value="Surname:" />
						</p:column>
						<p:column>
							<h:outputText id="surname" value="#{login.employee.surname}"/>
						</p:column>
					</p:row>
					
					<p:row>
						<p:column>
							<p:outputLabel for="name" value="Name:" />
						</p:column>
						<p:column>
							<h:outputText id="name" value="#{login.employee.name}"/>
						</p:column>
					</p:row>
					
					<p:row>
						<p:column>
							<p:outputLabel for="code" value="Code:" />
						</p:column>
						<p:column>
							<h:outputText id="code" value="#{login.employee.codfisc}"/>
						</p:column>
					</p:row>
					
					<p:row>
						<p:column>
							<p:outputLabel for="username" value="Username:" />
						</p:column>
						<p:column>
							<h:outputText id="username" value="#{login.employee.username}"/>
						</p:column>
					</p:row>
					
					<p:row>
						<p:column>
							<p:outputLabel for="password" value="Password:" />
						</p:column>
						<p:column>
							<h:outputText id="password" value="#{login.employee.password}"/>
						</p:column>
					</p:row>
					
					  
					<ui:fragment rendered="#{login.employee.getClass().getSimpleName() =='Salaried'}">
					<p:row>
						<p:column>
							<p:outputLabel for="monthly_salary" value="Monthly salary:" />
						</p:column>
						<p:column>
							<h:outputText id="monthly_salary" value="#{personalData.getMonthlySalary(login.employee)}"/>
						</p:column>
					</p:row>
					</ui:fragment>
					
					
					
					<ui:fragment rendered="#{login.employee.getClass().getSimpleName() eq 'Contractor'}">
					<p:row>
						<p:column>
							<p:outputLabel for="hourly_rate" value="Hourly rate:" />
						</p:column>
						<p:column>
							<h:outputText id="hourly_rate" value="#{personalData.getHourlyRate(login.employee)}"/>
						</p:column>
					</p:row>
					</ui:fragment>
					
					<ui:fragment
						rendered="#{login.employee.getClass().getSimpleName() =='Commissioned'}">
						<p:row>
							<p:column>
								<p:outputLabel for="sales_percent"
									value="Percentage on sales:" />
							</p:column>
							<p:column>
								<h:outputText id="sales_percent"
									value="#{personalData.getSalesPercent(login.employee)}" />
							</p:column>
					</p:row>
					</ui:fragment>
				  
					
				</p:panelGrid>
			
</body>
</html>
